package com.demo1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 故我
 * Date: 2023-10-27
 * Time: 22:55
 */
@Controller
public class AController {
    @Autowired
    private BController bController;// 1

    @PostConstruct
    public void postConstruct() {
        bController.SayHi();//2 先执行属性注入，再执行构造
        System.out.println("执行 A postConstruct 方法");
    }
}
